import { http } from "@/utils/http";

type ResultTable = {
  total?: number;
  data?: Array<any>;
};

//预算项目表 新增
export const projectadd = (data?: object) => {
  return http.request<ResultTable>("post", `/operation/api/v1/water/budget/project/add`, {
    data
  });
};

//预算项目表 查询详情
export const projectqueryDetail = (data?: object) => {
  return http.request<ResultTable>("post", `/operation/api/v1/water/budget/project/queryDetail`, {
    data
  });
};

//预算项目表 查询列表
export const projectqueryListPage = (data?: object) => {
  return http.request<ResultTable>("post", `/operation/api/v1/water/budget/project/queryListPage`, {
    data
  });
};

//预算项目表 删除
export const projectdelete = (data?: object) => {
  return http.request<ResultTable>("post", `/operation/api/v1/water/budget/project/delete`, {
    data
  });
};

//预算项目表 修改
export const projectupdate = (data?: object) => {
  return http.request<ResultTable>("post", `/operation/api/v1/water/budget/project/update`, {
    data
  });
};

//预算项目表 列表查询下拉框 项目名称
export const projectqueryDropDownProjectName = (data?: object) => {
  return http.request<ResultTable>("post", `/operation/api/v1/water/budget/project/queryDropDownProjectName`, {
    data
  });
};

//预算项目表 列表查询下拉框 负责人名称
export const projectqueryDropDownOwnerName = (data?: object) => {
  return http.request<ResultTable>("post", `/operation/api/v1/water/budget/project/queryDropDownOwnerName`, {
    data
  });
};

//预算项目表 列表查询下拉框 品名
export const projectqueryDropDownProductName = (data?: object) => {
  return http.request<ResultTable>("post", `/operation/api/v1/water/budget/project/queryDropDownProductName`, {
    data
  });
};

//预算项目表 列表查询下拉框 厂商
export const projectqueryDropDownVendor = (data?: object) => {
  return http.request<ResultTable>("post", `/operation/api/v1/water/budget/project/queryDropDownVendor`, {
    data
  });
};

//预算PO明细执行表 查询列表
export const poDetailExecutequeryList = (data?: object) => {
  return http.request<ResultTable>("post", `/operation/api/v1/water/budget/poDetailExecute/queryList`, {
    data
  });
};

//预算PO明细执行表 修改明细
export const poupdate = (data?: object) => {
  return http.request<ResultTable>("post", `/operation/api/v1/water/budget/po/update`, {
    data
  });
};

//PO明细 查询化学品品名
export const poDetailqueryChemicalProductName = (data?: object) => {
  return http.request<ResultTable>("post", `/operation/api/v1/water/budget/poDetail/queryChemicalProductName`, {
    data
  });
};

//PO明细 查询废弃物品名
export const poDetailqueryWasteProductName = (data?: object) => {
  return http.request<ResultTable>("post", `/operation/api/v1/water/budget/poDetail/queryWasteProductName`, {
    data
  });
};

//预算PO表 查询PO明细
export const poqueryInfo = (data?: object) => {
  return http.request<ResultTable>("post", `/operation/api/v1/water/budget/po/queryInfo`, {
    data
  });
};

//预算PO明细 列表查询下拉框 品名
export const poDetailExecutequeryDropDownProductName = (data?: object) => {
  return http.request<ResultTable>("post", `/operation/api/v1/water/budget/poDetailExecute/queryDropDownProductName`, {
    data
  });
};

//预算项目表 修改列表收获数量
export const projectupdateReceiveQuantity = (data?: object) => {
  return http.request<ResultTable>("post", `/operation/api/v1/water/budget/project/updateReceiveQuantity`, {
    data
  });
};

//po详情项目表 修改列表收获数量
export const poDetailExecuteupdateExecuteQuantity = (data?: object) => {
  return http.request<ResultTable>("post", `/operation/api/v1/water/budget/poDetailExecute/updateExecuteQuantity`, {
    data
  });
};

//预算项目表 关闭打开
export const projectupdateCloseFlag = (data?: object) => {
  return http.request<ResultTable>("post", `/operation/api/v1/water/budget/project/updateCloseFlag`, {
    data
  });
};

//预算项目表 导入
export const projectuploadFile = (data?: object | undefined, cb?: (err: any) => any) =>
  http.request<Array<TableItem>>(
    "post",
    `/operation/api/v1/water/budget/project/uploadFile`,
    { data },
    { headers: { noLoading: true, "Content-Type": "multipart/form-data" } },
    cb
  );
